package com.example.wanandroid_copy2.ui.collect.data.model

object CollectState {

    var listeners = ArrayList<CollectRefreshListener>()

    fun addListener(listener: CollectRefreshListener) {
        listeners.add(listener)
    }

    fun removeListener(listener: CollectRefreshListener) {
        listeners.remove(listener)
    }

    fun notifyCollectState(id : Int, originId : Int) {
        for (listener in listeners) {
            listener.onCollectRefresh(id, originId)
        }
    }
}